package com.sutuijingling.a;

import android.graphics.Point;
import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.sutuijingling.utils.c;

public class a extends e {
    static String a = "/data/local/tmp/open_008.sh";

    public a(UiDevice uiDevice) {
        this.device = uiDevice;
        System.out.println(" init imei viewer :" + this.device);
    }

    protected boolean a() {
        return isPackage("com.soft.apk008v", 1);
    }

    public void b() {
        try {
            c.c(findTextContain("用户名", 2));
        } catch (UiObjectNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void c() {
        int displayWidth = this.device.getDisplayWidth();
        int displayHeight = this.device.getDisplayHeight();
        int i = (displayWidth * 1) / 4;
        displayWidth = (displayWidth * 3) / 4;
        int i2 = (displayHeight * 1) / 4;
        displayHeight = (displayHeight * 3) / 4;
        System.out.println(String.format(" swipe [%d],[%d],[%d],[%d]", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(displayWidth), Integer.valueOf(displayHeight)}));
        c.a(this.device, new Point(i, i2), new Point(displayWidth, displayHeight), 4);
    }

    public UiObject d() {
        return findByResId("com.soft.apk008v:id/main_centerImg", 1);
    }

    public UiObject e() {
        return findByResId("com.soft.apk008v:id/button_random", 1);
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void f() throws com.sutuijingling.result.c, com.android.uiautomator.core.UiObjectNotFoundException {
        /*
        r9 = this;
        r8 = 404; // 0x194 float:5.66E-43 double:1.996E-321;
        r7 = 5;
        r3 = 1;
        r1 = 0;
        r0 = "DSChange008Viewer";
        r2 = new java.lang.Object[r3];
        r4 = new java.lang.StringBuilder;
        r4.<init>();
        r5 = "DSChange008Viewer current package???";
        r4 = r4.append(r5);
        r5 = r9.fetchPackage();
        r4 = r4.append(r5);
        r4 = r4.toString();
        r2[r1] = r4;
        com.sutuijingling.utils.b.b(r0, r2);
        r0 = r1;
    L_0x0026:
        r2 = r9.a();
        if (r2 != 0) goto L_0x006c;
    L_0x002c:
        r2 = "DSChange008Viewer";
        r4 = new java.lang.Object[r3];
        r5 = new java.lang.StringBuilder;
        r5.<init>();
        r6 = "DSChange008Viewer current package???";
        r5 = r5.append(r6);
        r6 = r9.fetchPackage();
        r5 = r5.append(r6);
        r5 = r5.toString();
        r4[r1] = r5;
        com.sutuijingling.utils.b.b(r2, r4);
        com.sutuijingling.utils.c.f();
        r2 = a;
        com.sutuijingling.utils.c.b(r2);
        com.sutuijingling.utils.c.f();
        r2 = r0 + 1;
        if (r0 <= r7) goto L_0x015a;
    L_0x005b:
        r0 = new com.sutuijingling.result.c;
        r2 = " can't open 008apk ..";
        r0.<init>(r8, r2);
        r2 = r0.getMessage();
        r1 = new java.lang.Object[r1];
        com.sutuijingling.utils.b.a(r0, r2, r1);
        throw r0;
    L_0x006c:
        r0 = "DSChange008Viewer";
        r2 = new java.lang.Object[r3];
        r4 = new java.lang.StringBuilder;
        r4.<init>();
        r5 = "DSChange008Viewer current package???";
        r4 = r4.append(r5);
        r5 = r9.fetchPackage();
        r4 = r4.append(r5);
        r4 = r4.toString();
        r2[r1] = r4;
        com.sutuijingling.utils.b.b(r0, r2);
    L_0x008c:
        r0 = r9.d();
        if (r0 == 0) goto L_0x008c;
    L_0x0092:
        r2 = r0.exists();
        if (r2 == 0) goto L_0x008c;
    L_0x0098:
        r2 = "DSChange008Viewer no entry for the modification entry exist...";
        r9.ensureExist(r0, r2);
        r9.debugUiObject(r0);
        r2 = r0.exists();
        if (r2 == 0) goto L_0x00ac;
    L_0x00a6:
        com.sutuijingling.utils.c.d(r0);
        com.sutuijingling.utils.c.f();
    L_0x00ac:
        r0 = r9.e();
        r2 = "DSChange008Viewer";
        r4 = new java.lang.Object[r3];
        r5 = new java.lang.StringBuilder;
        r5.<init>();
        r6 = "DSChange008Viewer rand btn exist???[";
        r5 = r5.append(r6);
        r6 = r0.exists();
        r5 = r5.append(r6);
        r6 = "]";
        r5 = r5.append(r6);
        r5 = r5.toString();
        r4[r1] = r5;
        com.sutuijingling.utils.b.b(r2, r4);
        r2 = "DSChange008Viewer rand button not found??";
        r9.ensureExist(r0, r2);
        com.sutuijingling.utils.c.c(r0);
        com.sutuijingling.utils.c.e();
        com.sutuijingling.utils.c.c(r0);
        com.sutuijingling.utils.c.e();
        r0 = "com.soft.apk008v:id/button_restore";
        r2 = 2;
        r0 = r9.findByResId(r0, r2);
        com.sutuijingling.utils.c.c(r0);
        com.sutuijingling.utils.c.c();
        r0 = r9.device;
        r0.pressBack();
        com.sutuijingling.utils.c.b();
        r0 = r1;
    L_0x00fd:
        r2 = r0 + 1;
        if (r0 >= r7) goto L_0x0158;
    L_0x0101:
        r0 = r9.device;
        r0.pressBack();
        com.sutuijingling.utils.c.b();
        r0 = "android:id/button2";
        r0 = r9.findByResId(r0, r3);
        r4 = r0.exists();
        if (r4 == 0) goto L_0x0155;
    L_0x0115:
        r4 = "android:id/button1";
        r4 = r9.findByResId(r4, r3);
        r4 = r4.exists();
        if (r4 == 0) goto L_0x0155;
    L_0x0121:
        r4 = "android:id/parentPanel";
        r4 = r9.findByResId(r4, r3);
        r4 = r4.exists();
        if (r4 == 0) goto L_0x0155;
    L_0x012d:
        r4 = 10000; // 0x2710 float:1.4013E-41 double:4.9407E-320;
        com.sutuijingling.utils.c.a(r0, r4);
        r0 = r3;
    L_0x0133:
        com.sutuijingling.utils.c.d();
        r2 = r9.device;
        r2.pressBack();
        com.sutuijingling.utils.c.d();
        r2 = r9.device;
        r2.pressBack();
        com.sutuijingling.utils.c.b();
        if (r0 != 0) goto L_0x0157;
    L_0x0148:
        r0 = " fail for count";
        r1 = new java.lang.Object[r1];
        com.sutuijingling.utils.b.b(r0, r1);
        r0 = new com.sutuijingling.result.c;
        r0.<init>(r8);
        throw r0;
    L_0x0155:
        r0 = r2;
        goto L_0x00fd;
    L_0x0157:
        return;
    L_0x0158:
        r0 = r1;
        goto L_0x0133;
    L_0x015a:
        r0 = r2;
        goto L_0x0026;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.sutuijingling.a.a.f():void");
    }
}
